import axios from "axios";
import NproGress from 'nprogress'
import 'nprogress/nprogress.css'
import { Message } from 'antd'

// 
// process.env.NODE_ENV

axios.interceptors.request.use((config) => {
    //
    NproGress.start()
    const token = localStorage.getItem("token")? localStorage.getItem("token"): ''
    config.headers.Authorization = token
    return config
})

axios.interceptors.response.use((data) => {
    NproGress.done()
    Message.success(data.data.message)
    return data
})

export default axios